#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
  int ret =fork();
  if(ret==0)
  {
    printf("child ret:%d\n",ret);
    printf("I am a child  my pid is %d my father is %d\n ",getpid(),getppid());
  }
  else if(ret<0)
  {
    perror("error");
  }
  else 
  {
    printf("father ret:%d\n",ret);
    printf("I am a father  my pid is %d my father is %d \n",getpid(),getppid());
  }
  sleep(1);
  return 0;

}
